package com.zhuangjie.shop.pojo;

import com.baomidou.mybatisplus.annotation.TableField;
import com.zhuangjie.mvc.helper.GeoHelper.GeoCoordinates;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.math.BigDecimal;

/**
 * 店铺经营配置
 *
 * @author zhuangjie
 * @date 2024/03/07
 */
@Data
public class ShopBusinessConfig extends GeoCoordinates {

    @ApiModelProperty(value = "店铺类型_门店类型id")
    @TableField("shop_category_id")
    @NotNull(message = "门店类型id不能为空")
    private Long shopCategoryId;

//    @ApiModelProperty(value = "经度")
//    @TableField("longitude")
//    @NotNull(message = "经度不能为空")
//    private Double longitude;
//
//    @ApiModelProperty(value = "纬度")
//    @TableField("latitude")
//    @NotNull(message = "纬度不能为空")
//    private Double latitude;

    @ApiModelProperty(value = "经营类型(1支持配送、2支持店食、3、支持自提）可多选逗号隔开,单项叫receivingMethod")
    @TableField("business_type")
    @NotBlank(message = "经营类型不能为空")
    private String businessType;

    @ApiModelProperty(value = "配送方式（1平台配送，2商家配送）")
    @TableField("delivery_method")
    @NotNull(message = "配送方式不能为空")
    private Short deliveryMethod;

    @ApiModelProperty(value = "最低起送")
    @TableField("minimum_delivery_amount")
    @Min(message = "最低起送不能小于0",value = 0)
    private BigDecimal minimumDeliveryAmount;

    @ApiModelProperty(value = "餐盒费用")
    @TableField("packing_fee")
    @Min(message = "餐盒费用不能小于0",value = 0)
    private BigDecimal packingFee;

    @ApiModelProperty(value = "经营范围（公里）")
    @TableField("business_scope")
    @Min(message = "经营范围不能小于0",value = 0)
    private Double businessScope;

    @ApiModelProperty(value = "省份编码")
    @TableField("province_code")
    @NotBlank(message = "省份编码不能为空")
    private String provinceCode;

    @ApiModelProperty(value = "省份名称")
    @TableField("province_name")
    @NotBlank(message = "省份名称不能为空")
    private String provinceName;

    @ApiModelProperty(value = "城市编码")
    @TableField("city_code")
    @NotBlank(message = "城市编码不能为空")
    private String cityCode;

    @ApiModelProperty(value = "城市名称")
    @TableField("city_name")
    @NotBlank(message = "城市名称不能为空")
    private String cityName;

    @ApiModelProperty(value = "区县编码")
    @TableField("district_code")
    @NotBlank(message = "区县编码不能为空")
    private String districtCode;

    @ApiModelProperty(value = "区县名称")
    @TableField("district_name")
    @NotBlank(message = "区县名称不能为空")
    private String districtName;

    @ApiModelProperty(value = "具体地址描述")
    @TableField("address_describe")
    @NotBlank(message = "具体地址描述不能为空")
    private String addressDescribe;

    @ApiModelProperty(value = "每公里配送所需时间（分钟）")
    @TableField("delivery_time_per_km")
    @NotNull(message = "每公里配送所需时间不能为空")
    private Integer deliveryTimePerKm;

    @ApiModelProperty(value = "制作餐食所需时间（分钟）")
    @TableField("make_time")
    @NotNull(message = "制作餐食所需时间不能为空")
    private Integer makeTime;

    @ApiModelProperty(value = "允许提前预定的天数(-1，表示不允许预定，既然是今天，0是今天，1明天，..)")
    @TableField("advance_booking_days")
    @NotNull(message = "允许提前预定的天数不能为空")
    private Integer advanceBookingDays ;


    @ApiModelProperty(value = "商家保障配送费不超过的费用，超过的部分（从商家单中扣除给外卖员）")
    @TableField(value = "delivery_fee")
    @Min(value = 0, message = "配送费必须大于等于0")
    private BigDecimal deliveryFee;

}
